import React from "react";
import { useSelector, useDispatch } from "react-redux";

const Child1 = () => {
  const count = useSelector((state) => state.counter.count);
  const dispatch = useDispatch();

  return (
    <>
      <div>child1</div>
      <button onClick={() => dispatch({ type: "minus" })}>-</button>
      <span>{count}</span>
      <button onClick={() => dispatch({ type: "addAction" })}>+</button>
    </>
  );
};

export default Child1;
